package com.itheima;

import java.util.Scanner;

/**
 * 2025/4/12 9:37
 * 测试电影信息展示系统
 */
public class TestMovieOperation {
    public static void main(String[] args) {

        //定义一个数组Movie[] movies;
        Movie[] movies = new Movie[6];
        movies[0] = new Movie(1,"《肖申克的救赎》",19.9);
        movies[1] = new Movie(2,"《霸王别姬》",29.9);
        movies[2] = new Movie(3,"《阿甘正传》",39.9);
        movies[3] = new Movie(4,"《哪吒2》",49.9);
        movies[4] = new Movie(5,"《红海行动》",59.9);
        movies[5] = new Movie(6,"《速度与激情8》",69.9);
        //创建MovieOperation对象
        MovieOperation movieOperation = new MovieOperation(movies);
        //调用MovieOperation对象的方法
        movieOperation.printInfo();
        System.out.println("----------------------");

        //1. 创建Scanner对象
        Scanner scanner = new Scanner(System.in);
        //给用户一个友好的提示
        System.out.println("请输入您要查询的电影编号（整数）：");
        //2. 调用scanner的方法，监听键盘录入事件
        int id = scanner.nextInt();//线程阻塞的方法
        //查询ById
        movieOperation.findById(id);
        //关闭资源
        scanner.close();
    }
}
